import React, { Component, useEffect, useState } from 'react'
import axios from 'axios'

const FetchBookList = () => {
  return axios.get('http://47.101.45.245:3005/api/findBookList')
}

const FetchAddBookRack = () => {
  return axios.get('http://127.0.0.1:3005/api/findBookList')
}

export default () => {
  const [bookList, setBookList] = useState<any[]>([])
  useEffect(() => {
    FetchBookList().then(response => {
      console.log('response:....:', response)
      setBookList([...response.data.data])
    })
  }, [])
  return (
    <div>
      BookList
      {
        bookList.map(item => {
          return <div key={item.id}>
           <h1>{item.bookName}</h1>
           <h2>{item.createTime}</h2>
           <h3></h3>
          </div>
        })
      }
      {/* 渲染书籍接口 */}
      {/* 加入书架接口 */}
      {/* 跳转详情事件/bookId */}
    </div>
  )
}
